//
//  CourseModel.m
//  网易公开课项目
//
//  Created by 林 艺 on 13-11-11.
//  Copyright (c) 2013年 Marklin. All rights reserved.
//



#import "CourseModel.h"

@implementation CourseModel

- (id)init
{
    self = [super init];
    if (self) {
        _videoList = [[NSMutableArray alloc] init];
        _downloadList = [[NSMutableArray alloc] init];
        _downloadedList = [[NSMutableArray alloc] init];
    }
    return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.description forKey:@"kDescription"];
    [aCoder encodeObject:self.director forKey:@"kDirector"];
    [aCoder encodeObject:self.imagePath forKey:@"kImagePath"];
    [aCoder encodeObject:self.includeVirtual forKey:@"kIncludeVirtual"];
    [aCoder encodeObject:self.playcount forKey:@"kPlaycount"];
    [aCoder encodeObject:self.plid forKey:@"kPlid"];
    [aCoder encodeObject:self.school forKey:@"kSchool"];
    [aCoder encodeObject:self.source forKey:@"kSource"];
    [aCoder encodeObject:self.subtitle forKey:@"kSubtitle"];
    [aCoder encodeObject:self.tags forKey:@"kTags"];
    [aCoder encodeObject:self.title forKey:@"kTitle"];
    [aCoder encodeObject:self.type forKey:@"kType"];
    [aCoder encodeObject:self.updatedPlaycount forKey:@"kUpdatedPlaycount"];
    [aCoder encodeObject:self.videoList forKey:@"kVideoList"];
    [aCoder encodeObject:self.downloadList forKey:@"kDownloadList"];
    [aCoder encodeObject:self.downloadedList forKey:@"kDownloadedList"];
    [aCoder encodeInteger:self.isBookmark forKey:@"kIsBookmark"];
    [aCoder encodeInteger:self.lastPlaySeconds forKey:@"kLastPlaySeconds"];
    [aCoder encodeObject:self.lastPlayPnumber forKey:@"kLastPlayPnumber"];
    [aCoder encodeFloat:self.lastPlayTime forKey:@"kLastPlayTime"];
    [aCoder encodeInteger:self.indentify forKey:@"kIndentify"];
}

-(id)initWithCoder:(NSCoder *)aDecoder
{

    if (self = [super init]) {
        self.description = [aDecoder decodeObjectForKey:@"kDescription"];
        self.director = [aDecoder decodeObjectForKey:@"kDirector"];
        self.imagePath = [aDecoder decodeObjectForKey:@"kImagePath"];
        self.includeVirtual = [aDecoder decodeObjectForKey:@"kIncludeVirtual"];
        self.playcount = [aDecoder decodeObjectForKey:@"kPlaycount"];
        self.plid = [aDecoder decodeObjectForKey:@"kPlid"];
        self.school = [aDecoder decodeObjectForKey:@"kSchool"];
        self.source = [aDecoder decodeObjectForKey:@"kSource"];
        self.subtitle = [aDecoder decodeObjectForKey:@"kSubtitle"];
        self.tags = [aDecoder decodeObjectForKey:@"kTags"];
        self.title = [aDecoder decodeObjectForKey:@"kTitle"];
        self.type = [aDecoder decodeObjectForKey:@"kType"];
        self.updatedPlaycount = [aDecoder decodeObjectForKey:@"kUpdatedPlaycount"];
        self.videoList = [aDecoder decodeObjectForKey:@"kVideoList"];
        self.downloadList = [aDecoder decodeObjectForKey:@"kDownloadList"];
        self.downloadedList = [aDecoder decodeObjectForKey:@"kDownloadedList"];
        self.isBookmark = [aDecoder decodeIntegerForKey:@"kIsBookmark"];
        self.lastPlaySeconds = [aDecoder decodeIntegerForKey:@"kLastPlaySeconds"];
        self.lastPlayPnumber = [aDecoder decodeObjectForKey:@"kLastPlayPnumber"];
         self.lastPlayTime = [aDecoder decodeFloatForKey:@"kLastPlayTime"];
        self.indentify = [aDecoder decodeIntegerForKey:@"kIndentify"];
    }
    return self;
}

@end
